"""
============================
@auther:多测师-黄sir
@time:2021/9/8:14:32
@email:hw18983616870@163.com
@website:www.duoceshi.cn
============================
"""
import unittest
from public.utlis.HTMLTestRunner3_New import HTMLTestRunner
from public.utlis.mail3 import SendMail
from config.Config import *
def run():
    discover = unittest.defaultTestLoader.discover(start_dir=testcase_path,pattern='Test*.py')
    filename = report_path+'\\'+'BBS_UI_report.html'
    f = open(file=filename,mode='wb')
    runner = HTMLTestRunner(stream=f,
                            title='BBS论坛自动化测试报告',
                            description='用例执行情况如下：',
                            tester='dcs_sh18'
                            )
    runner.run(discover)
    f.close()
    send_mail = SendMail(send_msg=filename,attachment=filename)
    send_mail.send_mail()
run()